﻿using InventoryIssue.API.Read.Application.Command.Allocate;
using InventoryIssue.Domain;
using InventoryIssue.Dtos;
using InventoryIssue.DTOs;
using InventoryIssue.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Text;

namespace InventoryIssue.API.Read.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AllocateController : ControllerBase
    {
        private readonly IMediator mediator;

        public AllocateController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 查询调拨信息接口
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPaging<AllocateDto>> GetAllocate([FromQuery]GetAllocateCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 调拨产品信息接口
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<List<AllocateProductDto>>> GetAllocateProduct([FromQuery]GetAllocateProductCommand request)
        {
            return await mediator.Send(request);
        }
       
       
      
        /// <summary>
        /// 调拨单状态说明查询接口
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<AllocateStatusDto>> GetAllocateStatus([FromQuery]GetAllocateStatusCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 操作说明
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPaging<OperationLog>> GetAllocateOperationLogCommand([FromQuery] GetAllocateOperationLogCommand request)
        {
            return await mediator.Send(request);
        }

        /// <summary>
        /// 生成调拨完整报告
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        /*[HttpGet]
        public async Task<APIResult<AllocateReportDto>> GenerateAllocateReport([FromQuery]GenerateAllocateReportCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 操作记录查询接口
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIPaging<OperationRecordDto>> GetOperationRecord([FromQuery]GetOperationRecordCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 调拨单状态说明查询接口
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<AllocateStatusDto>> GetAllocateStatus([FromQuery]GetAllocateStatusCommand request)
        {
            return await mediator.Send(request);
        }

        /// <summary>
        /// 生成调拨完整报告
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<AllocateReportDto>> GenerateAllocateReport([FromQuery]GenerateAllocateReportCommand request)
        {
            return await mediator.Send(request);
        }

        /// <summary>
        /// 生成调拨汇总报告
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<AllocateSummaryReportDto>> GenerateAllocateSummaryReport([FromQuery]GenerateAllocateSummaryReportCommand request)
        {
            return await mediator.Send(request);
        }*/





    }
}
